package util

import (
	"github.com/bwmarrin/snowflake"
)

var nodeInstance *snowflake.Node

func InitSnowflake(node int64) error {
	// SnowFlake初始化
	var err error
	nodeInstance, err = snowflake.NewNode(node)
	return err
}

func GenSnowflakeInt64() int64 {
	return nodeInstance.Generate().Int64()
}
